<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>"/>    
    <title>群聚网</title>    
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	 <link rel="stylesheet" href="/css/pager.css" type="text/css"></link>
	<script type="text/javascript" src="/js/jquery-1.4.4.min.js"></script>
	
	<script src="js/formValidator-4.1.0.js" type="text/javascript" charset="UTF-8"></script>
	<script src="js/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
	<script language="javascript" type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
	
	<!--[if lte IE 6]>
	<link type="text/css" rel="stylesheet" href="Css/calendarIE6.css" >
	<![endif]--> 
	<!--[if gte IE 7]>
	<link type="text/css" rel="stylesheet" href="Css/calendar.css" >
	<![endif]--> 
	<![if !IE]> 
	<link type="text/css" rel="stylesheet" href="css/calendar.css" />
	<![endif]>
	<script type="text/javascript" src="js/calendar.js" ></script>  
	<script type="text/javascript" src="js/calendar-zh.js" ></script>
	<script type="text/javascript" src="js/calendar-setup.js"></script>
	<script type="text/javascript" src="js/ShouHu.js"></script>

	<script type="text/javascript" src="/js/pageView.js"></script> 
	<script src="js/taobao.js"></script>
	<script src="/js/jquery.KinSlideshow-1.2.1.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="/js/uploadify/swfobject.js"></script>
	<script type="text/javascript" src="/js/uploadify/task_jquery.uploadify.v2.1.4.js"></script>
	<link href="/css/uploadify.css" type="text/css" rel="stylesheet" />
		
	 <script type="text/javascript">
	 $(document).ready(function(){
			$("#bb1").click(function(){
				$("#renshuxianzhi").show("slow");
				$("#taonum").hide("slow");
				$("#youxiaoqi1").hide("slow");
				$("#youxiaoqi2").hide("slow");
				$("#tuangoukaishi").hide("slow");
				$("#tuangoujieshu").hide("slow");
			});
			$("#bb2").click(function(){
				$("#renshuxianzhi").hide("slow");
				$("#youxiaoqi1").show("slow");
				$("#youxiaoqi2").show("slow");
				$("#taonum").show("slow");
				$("#tuangoukaishi").show("slow");
				$("#tuangoujieshu").show("slow");
			});

		});
		 
	 $(document).ready(function(){
			$.formValidator.initConfig({formID:"packForm",theme:"ArrowSolidBox",debug:false,submitOnce:true,
				onError:function(msg,obj,errorlist){
					$("#errorlist").empty();
					$.map(errorlist,function(msg){
						$("#errorlist").append("<li>" + msg + "</li>")
					});
					alert(msg);
				},
				submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...',
				onShowClass : "",
				onFocusClass : "",
				onCorrectClass : ""
			});
			$("#tcmc").formValidator({onShow:"请填写套餐名称",onFocus:"填写本店套餐名称,套餐至少2个字符,最多20个字符",onCorrect:"套餐可以使用"}).inputValidator({min:2,max:20,onError:"你输入的套餐不正确,请确认"})//.regexValidator({regExp:"username",dataType:"enum",onError:"用户名格式不正确"})
			$("#zsxm").formValidator({onShow:"请输真实姓名",onFocus:"用户名至少2个字符,最多10个字符",onCorrect:"该用户名可以注册"}).inputValidator({min:2,max:10,onError:"你输入的用户名非法,请确认"})//.regexValidator({regExp:"username",dataType:"enum",onError:"用户名格式不正确"})
			$("#password1").formValidator({onShow:"请输入密码",onFocus:"至少1个长度",onCorrect:"密码合法"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"密码不能为空,请确认"});
			$("#password2").formValidator({onShow:"输再次输入密码",onFocus:"至少1个长度",onCorrect:"密码一致"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"重复密码两边不能有空符号"},onError:"重复密码不能为空,请确认"}).compareValidator({desID:"password1",operateor:"=",onError:"2次密码不一致,请确认"});
			$("#zzs").formValidator({onShow:"请输入套餐最大人数",onCorrect:"人数格式正确"}).regexValidator({regExp:"intege1",dataType:"enum",onError:"人数格式不正确"});
			$("#sz").formValidator({onShow:"请输价格",onCorrect:"你的数字正确"}).regexValidator({regExp:"num",dataType:"enum",onError:"数字格式不正确"});
			$("#cb").formValidator({onShow:"请输价格",onCorrect:"你的数字正确"}).regexValidator({regExp:"num",dataType:"enum",onError:"数字格式不正确"});
			$("#zk").formValidator({onShow:"请输价格",onCorrect:"你的数字正确"}).regexValidator({regExp:"num",dataType:"enum",onError:"数字格式不正确"});
			$(":radio[name='xb_one']").formValidator({tipID:"sexTip",onShow:"请选择你的性别",onFocus:"没有第三种性别了，你选一个吧",onCorrect:"输入正确",defaultValue:["1"]}).inputValidator({min:1,max:1,onError:"性别忘记选了,请确认"});//.defaultPassed();
			$("#nl").formValidator({autoModify:true,onShow:"请输入的年龄（1-99岁之间）",onFocus:"只能输入1-99之间的数字哦",onCorrect:"恭喜你,你输对了"}).inputValidator({min:1,max:99,type:"value",onErrorMin:"你输入的值必须大于等于1",onError:"年龄必须在1-99之间，请确认"}).defaultPassed();
			$("#csny").formValidator({onShow:"请输入的出生日期",onFocus:"请输入的出生日期，不能全部是0哦",onCorrect:"你输入的日期合法"}).inputValidator({min:"1900-01-01",max:"2000-01-01",type:"date",onError:"日期必须在\"1900-01-01\"和\"2000-01-01\"之间"}).defaultPassed();
			$("#s_f_z_h").formValidator({ajax:true,onShow:"请输入15或18位的身份证",onFocus:"输入15或18位的身份证",onCorrect:"输入正确"}).functionValidator({fun:isCardID});
			$("#email").formValidator({onShow:"请输入邮箱",onFocus:"邮箱6-100个字符,输入正确了才能离开焦点",onCorrect:"恭喜你,你输对了",defaultValue:"@"}).inputValidator({min:6,max:100,onError:"你输入的邮箱长度非法,请确认"}).regexValidator({regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"你输入的邮箱格式不正确"});
			$("#xueli").formValidator({onShow:"请选择商户类型",onFocus:"商户类型选择",onCorrect:"谢谢你的配合",defaultValue:"a"}).inputValidator({min:1,onError: "你是不是忘记选择商户类型!"}).defaultPassed();
			$("#ewjy").formValidator({onShow:"无论你输入什么都会提示你额外校验出错",onFocus:"如果你输入\"猫冬\"，额外校验就会成功",onCorrect:"额外校验成功"}).inputValidator({min:1,onError:"这里至少要一个字符,请确认"}).functionValidator({
			    fun:function(val,elem){
			        if(val=="猫冬"){
					    return true;
				    }else{
					    return "额外校验失败,想额外校验通过，请输入\"猫冬\""
				    }
				}
			});
			$("#Tel_country").formValidator({tipID:"teltip",onShow:"请输入国家区号",onFocus:"国家区号2位数字",onCorrect:"恭喜你,你输对了",defaultValue:"86"}).regexValidator({regExp:"^\\d{2}$",onError:"国家区号不正确"});
			$("#Tel_area").formValidator({tipID:"teltip",onShow:"请输入地区区号",onFocus:"地区区号3位或4位数字",onCorrect:"恭喜你,你输对了"}).regexValidator({regExp:"^\\d{3,4}$",onError:"地区区号不正确"});
			$("#Tel_number").formValidator({tipID:"teltip",onShow:"请输入电话号码",onFocus:"电话号码7到8位数字",onCorrect:"恭喜你,你输对了"}).regexValidator({regExp:"^\\d{7,8}$",onError:"电话号码不正确"});
			$("#Tel_ext").formValidator({tipID:"teltip",onShow:"请输入分机号码",onFocus:"分机号码1到5位数字",onCorrect:"恭喜你,你输对了"}).regexValidator({regExp:"^\\d{1,5}$",onError:"分机号码不正确"});
			$(":checkbox[name='xqah_one']").formValidator({tipID:"test3Tip",onShow:"请选择你的兴趣爱好（至少选一个）",onFocus:"你至少选择1个",onCorrect:"恭喜你,你选对了"}).inputValidator({min:1,onError:"你选的个数不对"});
			$(":checkbox[name='xqah_more']").formValidator({tipID:"test2Tip",onShow:"请选择你的兴趣爱好(至少选择2个,最多选择3个)",onFocus:"你至少选择2个,最多选择3个",onCorrect:"恭喜你,你选对了",defaultValue:["7","8"]}).inputValidator({min:2,max:3,onError:"你选的个数不对(至少选择2个,最多选择3个)"});
			$(":radio[name='PackType']").formValidator({tipID:"tglxTip",onShow:"套餐类型一定要选哦",onFocus:"认真选择套餐",onCorrect:"套餐选择成功",defaultValue:["0"]}).inputValidator({min:1,max:1,onError:"请选择套餐类型"}).defaultPassed();
			$("#shouji").formValidator({empty:true,onShow:"请输入你的手机号码，可以为空哦",onFocus:"你要是输入了，必须输入正确",onCorrect:"谢谢你的合作",onEmpty:"你真的不想留手机号码啊？"}).inputValidator({min:11,max:11,onError:"手机号码必须是11位的,请确认"}).regexValidator({regExp:"mobile",dataType:"enum",onError:"你输入的手机号码格式不正确"});;
			$("#lxdh").formValidator({empty:true,onShow:"请输入你的联系电话，可以为空哦",onFocus:"格式例如：0577-88888888",onCorrect:"谢谢你的合作",onEmpty:"你真的不想留联系电话了吗？"}).regexValidator({regExp:"^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$",onError:"你输入的联系电话格式不正确"});
			$("#sjdh").formValidator({empty:true,onShow:"请输入你的手机或电话，可以为空哦",onFocus:"格式例如：0577-88888888或11位手机号码",onCorrect:"谢谢你的合作",onEmpty:"你真的不想留手机或电话了吗？"}).regexValidator({regExp:["tel","mobile"],dataType:"enum",onError:"你输入的手机或电话格式不正确"});
			$("#selectmore").formValidator({onShow:"按住CTRL可以多选",onFocus:"按住CTRL可以多选,至少选择2个",onCorrect:"谢谢你的合作",defaultValue:["0","1","2"]}).inputValidator({min:2,onError:"至少选择2个"});
			$("#ms").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
			$("#tczy").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
			$("#tcsm").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
			$("#fjts").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
			
		});
		function test(obj)
		{
			if(obj.value=="不校验身份证")
			{
				$("#sfzh").attr("disabled",true).unFormValidator(true);
				obj.value = "校验身份证";
			}
			else
			{
				$("#sfzh").attr("disabled",false).unFormValidator(false);
				obj.value = "不校验身份证";
			}
		}
		function test1(obj)
		{
			var initConfig = $('body').data('1');
			if(obj.value=="全角字符当做1个长度")
			{
				initConfig.wideword = false;
				obj.value = "全角字符当做2个长度";
			}
			else
			{
				initConfig.wideword = true;
				obj.value = "全角字符当做1个长度";
			}
			$('body').data(obj.validatorgroup,initConfig);
		}
	//  function checkMaxLen(obj,maxlength){
	//	   if(obj.value.length>maxlength){
	//	     obj.value = obj.value.substr(0,maxlength);
//		   }
	  //}
	</script>
	<script type="text/javascript">
  $(document).ready(function() {
		$('#file_upload_detail').uploadify({
			'uploader'  : 'js/uploadify/uploadify.swf',
		    'script'    : '/register.do?method=upload',
		    'cancelImg' : '/js/uploadify/cancel.png',
		    'buttonImg' : '/images/uploadPhoto_addPhoto_btn.gif',
		    'folder'    : '/uploads',
		    'queueID'   : 'taskFileDiv',
		    'auto'      : true,
		    'simUploadLimit' : 1,
			'removeCompleted': false,
		    'multi'		: true,
		    'queueSizeLimit' : 10,
		    'simUploadLimit' : 1,
			'removeCompleted': false,
		    'fileExt'   : '*.jpg;*.jpeg;*.gif;*.png;*.bmp',
			'fileDesc'  : 'Image Files (.JPG, .GIF, .PNG, .BMP)',
			'onComplete' : function (evt, queueID, fileObj, response, data) {
				//$("#imgName").val(response);
				//alert($("#imgName").val(response));
				//var newImgPath = '/images/houseImg/detail/' + response;
				//$("#imgTarget2").attr("src", newImgPath);
				//alert(response);
				//$("#imgName").val(response);
			}				
		});
	});		
			 
		</script>
  </head>
  
  <body>
     <%@ include file="/hader.jsp"%> 
     <div class="wrapper">
	<div class="cb"></div>
	<form action="/packinfo.do?method=addPack" method="post" id="packForm" enctype="multipart/form-data" > 
	<input type="hidden" id="businessId" name="businessInfoId" value="${businessId}" />
	<div class="tjshxx">
		<h2>提交套餐信息</h2>
		<div class="cb"></div>
		<div>
			<table cellpadding="0" cellspacing="0" width="100%" border="0">
				<tr>
					<td width="32%" align="right" valign="top">套餐类型：</td>
					<td width="68%" align="left" valign="top">
					<input type="radio" name="PackType" id="bb1" value="1" />标准套餐&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="radio" name="PackType" id="bb2" value="2" />团购专题<br />
					<span id="tglxTip"></span><span>填写本店提供的套餐</span></td>
				</tr>
				<tr>
					<td width="32%" align="right" valign="top">套餐名称：</td>
					<td width="68%" align="left" valign="top">
					<input id="tcmc" name="PackageName"  type="text" class="input1 w147 h19" /><br />
					<span id="tcmcTip"></span></td>
					
				</tr>
				
				<tr id="renshuxianzhi" style="display:none;">
					<td align="right" valign="top">套餐最大人数限制：</td>
					<td align="left" valign="top">
					<input  name="PackageMaxPeople" type="text" class="input1 w147 h19" /><br />
					</span><span>该套餐适合多少人来团体消费</span></td>
				</tr>	
				<tr>
					<td align="right" valign="top">市面价格：</td>
					<td align="left" valign="top">
					<input id="sz" name="price" type="text" class="input1 w147 h19" /><br />
					<span id="szTip"></span><span>该套餐在商家店面正常售价</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">成本价格：</td>
					<td align="left" valign="top">
					<input id="cb" name="realPrice"  type="text" class="input1 w147 h19" /><br />
					<span id="cbTip"></span><span>群聚网会员享受的优惠价</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">折扣价格：</td>
					<td align="left" valign="top">
					<input id="zk" name="zhekou"  type="text" class="input1 w147 h19" /><br />
					<span id="zkTip"></span><span>群聚网会员享受的折扣价</span></td>
				</tr>				
				
				
				<tr id="taonum" style="display:none;">
					<td align="right" valign="top">套餐份数：</td>
					<td align="left" valign="top">
					<input name="PackNum"  type="text" class="input1 w147 h19" /><br />
					<span>商家计划拿出多少份套餐来做团购活动。如果商家不限制套餐份数，那么无需填写</span></td>
				</tr>
				<tr id="youxiaoqi1"  style="display:none;">
					<td align="right" valign="top">群聚券有效期开始于：</td>
					<td align="left" valign="top">					
		
              	<input type="text" id="EntTime01" name="termStartTime1" class="Wdate" onFocus="WdatePicker({minDate:'%y-%M-{%d+1}'})"/>
				
				<br /><span>从这一天算起（包括当天），用户可以凭借团购券到商家消费，并在之前有预约</span></td>
			</tr>
				
				<tr id="youxiaoqi2"  style="display:none;">
					<td align="right" valign="top">群聚券有效期结束于：</td>
					<td align="left" valign="top">
		              		<input type="text" id="EntTime02" name="termEndTime1"   class="Wdate" onFocus="WdatePicker({minDate:'%y-%M-{%d+1}'})"/>
		            <br /><span>用户的团购券到了这一天如果还没有消费，只能退款处理</span></td>
				</tr>
				
				
				<tr id="tuangoukaishi"  style="display:none;">
					<td align="right" valign="top">团购开始日期：</td>
					<td align="left" valign="top">
		              		<input type="text" id="EntTime03" name="startTime1"   class="Wdate" onFocus="WdatePicker({minDate:'%y-%M-{%d+1}'})" />
					<br /><span>用户从这个时间算起，才可以购买此团购套餐</span></td>
				</tr>
				<tr id="tuangoujieshu"  style="display:none;">
					<td align="right" valign="top">团购终止日期：</td>
					<td align="left" valign="top">
		              		<input type="text" id="EntTime04" name="endTime1"   class="Wdate" onFocus="WdatePicker({minDate:'%y-%M-{%d+1}'})" />
					<br /><span>过了这个时间，无论套餐是否卖光，该套餐的团购活动将停止销售</span></td>
				</tr>
				
				
				
				<tr>
					<td align="right" valign="top">套餐摘要：</td>
					<td align="left" valign="top">
					<textarea id="tczy" name="PackageSummary"   cols="" rows="" class="input1 w362 h59"></textarea><br />
					<span id="tczyTip"></span><span>该套餐的简单摘要</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">套餐说明：</td>
					<td align="left" valign="top">
					<textarea id="tcsm" name="PackageExplain"    cols="" rows="" class="input1 w362 h59"></textarea><br />
					<span id="tcsmTip"></span><span>该套餐的消费说明</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">附加费提示：</td>
					<td align="left" valign="top">
					<textarea id="fjts" name="AdditionalTips"  cols="" rows="" class="input1 w362 h59"></textarea><br />
					<span id="fjtsTip"></span><span>改套餐可能涉及到的附加费用在此声明</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">套餐照片：</td>
					<td align="left" valign="top">
					<div id="taskFileDiv">
		           		<div class="yzc_upload_img">
						<input id="file_upload_detail" name="file_upload_detail" type="file" />
						</div>
						<div>
						<a href="javascript:$('#file_upload_detail').uploadifyClearQueue()">清除队列</a>
						</div>				
  				  	 </div><span>要求图片格式为480*320像素格式为JPG格式。至少上传一张图片</span></td>
				</tr>
			</table>
		</div>
	</div>
	<div class="cb"></div>
	<div align="center" style="padding-bottom:30px"><input type="submit" value="提交"  class="btn01" /></div>
	<div class="cb"></div>
	</form>
</div> 
  </body>
</html>
